//
//  Label.m
//  UI-03homeWork
//
//  Created by 402030900@qq.com on 16/7/18.
//  Copyright © 2016年 402030900@qq.com. All rights reserved.
//

#import "Label.h"

@implementation Label
- (instancetype)initWithFrame:(CGRect)frame word:(NSString *)word target:(nonnull id)target action:(nonnull SEL)action {
    self = [super initWithFrame:frame];
    if (self) {
        self.text = word;
        self.userInteractionEnabled = YES;
        UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc]initWithTarget:(target ) action:action];
        [self addGestureRecognizer:tap];
    }
    self.label = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 20, 20)];
    _label.backgroundColor = [UIColor yellowColor];
    return self;
}
@end
